/*
 * Copyright 2007-2008 Sun Microsystems, Inc.  All Rights Reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Sun designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Sun in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 * CA 95054 USA or visit www.sun.com if you need additional information or
 * have any questions.
 */

package jsr203.nio.file.attribute;

import jsr203.nio.file.FileRef;

/**
 * An attribute view that is a read-only or updatable view of non-opaque
 * values associated with a file in a filesystem. This interface extends
 * {@link AttributeView} to define the {@link #bind(FileRef,boolean)
 * bind} method to allow the attribute view to be bound to a reference to a
 * file and specify if symbolic links should be followed or not.
 *
 * @since 1.7
 */

public interface FileAttributeView
    extends AttributeView<FileRef>
{
    /**
     * Binds this attribute view to the given file reference.
     *
     * <p> This method is equivalent to invoking the {@link #bind(FileRef,boolean)
     * bind} method with the {@code followLinks} parameter set to a value of
     * {@code true}.
     *
     * @param   file
     *          The file to which attribute view should be bound, or
     *          {@code null} to discard the current association
     *
     * @return  this attribute view
     */
    @Override
    FileAttributeView bind(FileRef file);

    /**
     * Binds this attribute view to the given file reference. The {@code
     * followLinks} parameter specifies if links should be followed or not.
     * This parameter is ignored by implementations that do not support symbolic
     * links. Where symbolic links are supported, and the value of parameter is
     * {@code false}, then the attribute view provides access to the attributes
     * of the symbolic link (if supported by the implementation).
     *
     * @param   file
     *          The file to which attribute view should be bound, or
     *          {@code null} to discard the current association
     * @param   followLinks
     *          {@code true} if links should be followed
     *
     * @return  this attribute view
     */
    FileAttributeView bind(FileRef file, boolean followLinks);
}
